﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YJTShiftManagement.Events
{
    public sealed class EventManager
    {
        // 单例实例
        private static readonly Lazy<EventManager> _instance = new Lazy<EventManager>(() => new EventManager());
        public static EventManager Instance => _instance.Value;

        // 定义传递 string 的事件
        public event Action<string> OnStringEvent;

        // 私有构造函数确保单例
        private EventManager() { }

        // 触发事件的方法
        public void RaiseStringEvent(string data)
        {
            OnStringEvent?.Invoke(data);
        }
    }
}
